Rules for integrands of the form((P[x])^p) ((Q[x])^q)

0.  ∫((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))dx  when c d+a e==0

1:  ∫((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))dx  when c d+a e==0 ∧ a c>0

Derivation: Integration by substitution

Basis: If  c d+a e==0, then ((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))==(a/d) Subst[(1/(1-2 b (x^2)+((b^2)-4 a c) (x^4))),x,(x/(Sqrt[a+b (x^2)+c (x^4)]))] (∂_x)(x/(Sqrt[a+b (x^2)+c (x^4)]))

Rule 1.3.3.4.4.1: If  c d+a e==0 ∧ a c>0, then

∫((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))dx  ⟶  (a/d) Subst[∫(1/(1-2 b (x^2)+((b^2)-4 a c) (x^4)))dx,x,(x/(Sqrt[a+b (x^2)+c (x^4)]))]

Program code:

Int[Sqrt[v_]/(d_+e_.*x_^4),x_Symbol] :=
  With[{a=Coeff[v,x,0],b=Coeff[v,x,2],c=Coeff[v,x,4]},
  a/d*Subst[Int[1/(1-2*b*x^2+(b^2-4*a*c)*x^4),x],x,x/Sqrt[v]] /;
 EqQ[c*d+a*e,0] && PosQ[a*c]] /;
FreeQ[{d,e},x] && PolyQ[v,x^2,2]

2:  ∫((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))dx  when c d+a e==0 ∧ a c≯0

Rule 1.3.3.4.4.2: If  c d+a e==0 ∧ a c≯0, let q->(Sqrt[(b^2)-4 a c]), then

∫((Sqrt[a+b (x^2)+c (x^4)])/(d+e (x^4)))dx  ⟶  
-((a (Sqrt[b+q]))/(2 (Sqrt[2]) (Sqrt[-a c]) d)) ArcTan[(((Sqrt[b+q]) x (b-q+2 c (x^2)))/(2 (Sqrt[2]) (Sqrt[-a c]) (Sqrt[a+b (x^2)+c (x^4)])))]+((a (Sqrt[-b+q]))/(2 (Sqrt[2]) (Sqrt[-a c]) d)) ArcTanh[(((Sqrt[-b+q]) x (b+q+2 c (x^2)))/(2 (Sqrt[2]) (Sqrt[-a c]) (Sqrt[a+b (x^2)+c (x^4)])))]

Program code:

Int[Sqrt[a_+b_.*x_^2+c_.*x_^4]/(d_+e_.*x_^4),x_Symbol] :=
  With[{q=Sqrt[b^2-4*a*c]},
  -a*Sqrt[b+q]/(2*Sqrt[2]*Rt[-a*c,2]*d)*ArcTan[Sqrt[b+q]*x*(b-q+2*c*x^2)/(2*Sqrt[2]*Rt[-a*c,2]*Sqrt[a+b*x^2+c*x^4])] + 
  a*Sqrt[-b+q]/(2*Sqrt[2]*Rt[-a*c,2]*d)*ArcTanh[Sqrt[-b+q]*x*(b+q+2*c*x^2)/(2*Sqrt[2]*Rt[-a*c,2]*Sqrt[a+b*x^2+c*x^4])]] /;
FreeQ[{a,b,c,d,e},x] && EqQ[c*d+a*e,0] && NegQ[a*c]

1.  ∫((P[x])^p) ((Q[x])^q)dx  when  P[x]==P1[x] P2[x] ⋯

1:  ∫((P[(x^2)])^p) ((Q[x])^q)dx  when  p∈(SuperMinus[ℤ])∧ P[x]==P1[x] P2[x] ⋯

Derivation: Algebraic simplification

Note: This rule assumes host CAS distributes integer powers over products.

Rule: If  p∈(SuperMinus[ℤ])∧ P[x]==P1[x] P2[x] ⋯, then

∫((P[(x^2)])^p) ((Q[x])^q)dx  ⟶  ∫((P1[(x^2)])^p) ((P2[(x^2)])^p) ⋯ ((Q[x])^q) dx

Program code:

Int[P_^p_*Q_^q_.,x_Symbol] :=
  With[{PP=Factor[ReplaceAll[P,x->Sqrt[x]]]},
  Int[ExpandIntegrand[ReplaceAll[PP,x->x^2]^p*Q^q,x],x] /;
 Not[SumQ[NonfreeFactors[PP,x]]]] /;
FreeQ[q,x] && PolyQ[P,x^2] && PolyQ[Q,x] && ILtQ[p,0]

2:  ∫((P[x])^p) ((Q[x])^q)dx  when  p∈ℤ ∧ P[x]==P1[x] P2[x] ⋯

Derivation: Algebraic expansion

Note: This rule assumes host CAS distributes integer powers over products.

Rule: If  p∈ℤ ∧ P[x]==P1[x] P2[x] ⋯, then

∫((P[x])^p) ((Q[x])^q)dx  ⟶  ∫((P1[x])^p) ((P2[x])^p) ⋯ ((Q[x])^q) dx

Program code:

Int[P_^p_*Q_^q_.,x_Symbol] :=
  With[{PP=Factor[P]},
  Int[ExpandIntegrand[PP^p*Q^q,x],x] /;
 Not[SumQ[NonfreeFactors[PP,x]]]] /;
FreeQ[q,x] && PolyQ[P,x] && PolyQ[Q,x] && IntegerQ[p] && NeQ[P,x]

2:  ∫((P[x])^p) Q[x]dx  when  p∈(SuperMinus[ℤ])∧ P[x]==(a+b x+c (x^2)) (d+e x+f (x^2)) ⋯

Derivation: Algebraic expansion

Rule: If  p∈(SuperMinus[ℤ])∧ P[x]==(a+b x+c (x^2)) (d+e x+f (x^2)) ⋯, then

∫((P[x])^p) Q[x]dx  ⟶  ∫ExpandIntegrand[((P[x])^p) Q[x],x] dx

Program code:

Int[P_^p_*Qm_,x_Symbol] :=
  With[{PP=Factor[P]},
  Int[ExpandIntegrand[PP^p*Qm,x],x] /;
 QuadraticProductQ[PP,x]] /;
PolyQ[Qm,x] && PolyQ[P,x] && ILtQ[p,0]

3.  ∫(((e+f x))^m)(((a+b x+c (x^2)+d (x^3)))^p)dx

1.  ∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx

1.  ∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d==0

1:  ∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d==0 ∧ p∈ℤ

Derivation: Algebraic expansion

Basis: If  4 (b^3)+27 (a^2) d==0, then a+b x+d (x^3)==(1/((3^3) (a^2)))(3 a-b x) (((3 a+2 b x))^2)

Rule: If  4 (b^3)+27 (a^2) d==0 ∧ p∈ℤ, then

∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  ⟶  (1/((3^(3p)) (a^(2p))))∫(((e+f x))^m)(((3 a-b x) )^p)(((3 a+2 b x) )^(2p))dx

Program code:

Int[(e_.+f_.*x_)^m_.*(a_+b_.*x_+d_.*x_^3)^p_.,x_Symbol] :=
  1/(3^(3*p)*a^(2*p))*Int[(e+f*x)^m*(3*a-b*x)^p*(3*a+2*b*x)^(2*p),x] /;
FreeQ[{a,b,d,e,f,m},x] && EqQ[4*b^3+27*a^2*d,0] && IntegerQ[p]

2:  ∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d==0 ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis: If  4 (b^3)+27 (a^2) d==0, then (∂_x)((((a+b x+d (x^3)))^p)/((((3 a-b x))^p) (((3 a+2 b x))^(2 p))))==0

Rule: If  4 (b^3)+27 (a^2) d==0 ∧ p∉ℤ, then

∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  ⟶  ((((a+b x+d (x^3)))^p)/((((3 a-b x))^p) (((3 a+2 b x))^(2 p))))∫(((e+f x))^m)(((3 a-b x) )^p)(((3 a+2 b x) )^(2p))dx

Program code:

Int[(e_.+f_.*x_)^m_.*(a_+b_.*x_+d_.*x_^3)^p_,x_Symbol] :=
  (a+b*x+d*x^3)^p/((3*a-b*x)^p*(3*a+2*b*x)^(2*p))*Int[(e+f*x)^m*(3*a-b*x)^p*(3*a+2*b*x)^(2*p),x] /;
FreeQ[{a,b,d,e,f,m,p},x] && EqQ[4*b^3+27*a^2*d,0] && Not[IntegerQ[p]]

2.  ∫(((e+f x))^m)(((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d≠0

1.  ∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d≠0 ∧ p∈ℤ

1:  ∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d≠0 ∧ p∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  4 (b^3)+27 (a^2) d≠0 ∧ p∈(SuperPlus[ℤ]),

∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  ⟶  ∫ExpandIntegrand[(((e+f x))^m) (((a+b x+d (x^3)))^p),x]dx

Program code:

Int[(e_.+f_.*x_)^m_.*(a_+b_.*x_+d_.*x_^3)^p_.,x_Symbol] :=
  Int[ExpandIntegrand[(e+f*x)^m*(a+b*x+d*x^3)^p,x],x] /;
FreeQ[{a,b,d,e,f,m},x] && NeQ[4*b^3+27*a^2*d,0] && IGtQ[p,0]

2:  ∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d≠0 ∧ p∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: If  r->(((-9 a (d^2)+(Sqrt[3]) d(Sqrt[4 (b^3) d+27 (a^2) (d^2)])))^(1/3)), then a+b x+d (x^3)==((2 (b^3) d)/(3 (r^3)))-((r^3)/(18 (d^2)))+b x+d (x^3)

Basis: ((2 (b^3) d)/(3 (r^3)))-((r^3)/(18 (d^2)))+b x+d (x^3)==(1/(d^2))((((18^(1/3)) b d)/(3 r))-(r/(18^(1/3)))+d x) (((b d)/3)+(((12^(1/3)) (b^2) (d^2))/(3 (r^2)))+((r^2)/(3 (12^(1/3))))-d ((((2^(1/3)) b d)/((3^(1/3)) r))-(r/(18^(1/3)))) x+(d^2) (x^2))

Rule: If  4 (b^3)+27 (a^2) d≠0 ∧ p∈ℤ, let r->(((-9 a (d^2)+(Sqrt[3]) d(Sqrt[4 (b^3) d+27 (a^2) (d^2)])))^(1/3)), then

∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  ⟶  
(1/(d^(2 p)))∫(((e+f x))^m) ((((((18^(1/3)) b d)/(3 r))-(r/(18^(1/3)))+d x) )^p)(((((b d)/3)+(((12^(1/3)) (b^2) (d^2))/(3 (r^2)))+((r^2)/(3 (12^(1/3))))-d ((((2^(1/3)) b d)/((3^(1/3)) r))-(r/(18^(1/3)))) x+(d^2) (x^2)) )^p)dx

Program code:

Int[(e_.+f_.*x_)^m_.*(a_+b_.*x_+d_.*x_^3)^p_,x_Symbol] :=
  With[{r=Rt[-9*a*d^2+Sqrt[3]*d*Sqrt[4*b^3*d+27*a^2*d^2],3]},
  1/d^(2*p)*Int[(e+f*x)^m*Simp[18^(1/3)*b*d/(3*r)-r/18^(1/3)+d*x,x]^p*
    Simp[b*d/3+12^(1/3)*b^2*d^2/(3*r^2)+r^2/(3*12^(1/3))-d*(2^(1/3)*b*d/(3^(1/3)*r)-r/18^(1/3))*x+d^2*x^2,x]^p,x]] /;
FreeQ[{a,b,d,e,f,m},x] && NeQ[4*b^3+27*a^2*d,0] && ILtQ[p,0]

2:  ∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  when  4 (b^3)+27 (a^2) d≠0 ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis: If  r->(((-9 a (d^2)+(Sqrt[3]) d(Sqrt[4 (b^3) d+27 (a^2) (d^2)])))^(1/3)), then (∂_x)((((a+b x+d (x^3)))^p)/(((((((18^(1/3)) b d)/(3 r))-(r/(18^(1/3)))+d x) )^p)(((((b d)/3)+(((12^(1/3)) (b^2) (d^2))/(3 (r^2)))+((r^2)/(3 (12^(1/3))))-d ((((2^(1/3)) b d)/((3^(1/3)) r))-(r/(18^(1/3)))) x+(d^2) (x^2)) )^p)))==0

Rule: If  4 (b^3)+27 (a^2) d≠0 ∧ p∉ℤ, let r->(((-9 a (d^2)+(Sqrt[3]) d(Sqrt[4 (b^3) d+27 (a^2) (d^2)])))^(1/3)), then

∫(((e+f x))^m) (((a+b x+d (x^3)))^p)dx  ⟶  
((((a+b x+d (x^3)))^p)/(((((((18^(1/3)) b d)/(3 r))-(r/(18^(1/3)))+d x) )^p)(((((b d)/3)+(((12^(1/3)) (b^2) (d^2))/(3 (r^2)))+((r^2)/(3 (12^(1/3))))-d ((((2^(1/3)) b d)/((3^(1/3)) r))-(r/(18^(1/3)))) x+(d^2) (x^2)) )^p)))·
∫(((e+f x))^m) ((((((18^(1/3)) b d)/(3 r))-(r/(18^(1/3)))+d x) )^p)(((((b d)/3)+(((12^(1/3)) (b^2) (d^2))/(3 (r^2)))+((r^2)/(3 (12^(1/3))))-d ((((2^(1/3)) b d)/((3^(1/3)) r))-(r/(18^(1/3)))) x+(d^2) (x^2)) )^p)dx

Program code:

Int[(e_.+f_.*x_)^m_.*(a_+b_.*x_+d_.*x_^3)^p_,x_Symbol] :=
  With[{r=Rt[-9*a*d^2+Sqrt[3]*d*Sqrt[4*b^3*d+27*a^2*d^2],3]},
  (a+b*x+d*x^3)^p/
    (Simp[18^(1/3)*b*d/(3*r)-r/18^(1/3)+d*x,x]^p*
      Simp[b*d/3+12^(1/3)*b^2*d^2/(3*r^2)+r^2/(3*12^(1/3))-d*(2^(1/3)*b*d/(3^(1/3)*r)-r/18^(1/3))*x+d^2*x^2,x]^p)*
    Int[(e+f*x)^m*Simp[18^(1/3)*b*d/(3*r)-r/18^(1/3)+d*x,x]^p*
      Simp[b*d/3+12^(1/3)*b^2*d^2/(3*r^2)+r^2/(3*12^(1/3))-d*(2^(1/3)*b*d/(3^(1/3)*r)-r/18^(1/3))*x+d^2*x^2,x]^p,x]] /;
FreeQ[{a,b,d,e,f,m,p},x] && NeQ[4*b^3+27*a^2*d,0] && Not[IntegerQ[p]]

2:  ∫(((e+f x))^m) (((a+b x+c (x^2)+d (x^3)))^p)dx

Derivation: Integration by substitution

Rule: If  p∈(SuperMinus[ℤ])∧ (c^2)-3b d≠0 ∧ (b^2)-3a c≠0, then

∫(((e+f x))^m) (((a+b x+c (x^2)+d (x^3)))^p)dx  ⟶  Subst[∫(((((3 d e-c f)/(3 d))+f x))^m) (((((2 (c^3)-9 b c d+27 a (d^2))/(27 (d^2)))-((((c^2)-3 b d) x)/(3 d))+d (x^3)))^p)dx,x,x+(c/(3 d))]

Program code:

Int[(e_.+f_.*x_)^m_.*P3_^p_.,x_Symbol] :=
  With[{a=Coeff[P3,x,0],b=Coeff[P3,x,1],c=Coeff[P3,x,2],d=Coeff[P3,x,3]},
  Subst[Int[((3*d*e-c*f)/(3*d)+f*x)^m*Simp[(2*c^3-9*b*c*d+27*a*d^2)/(27*d^2)-(c^2-3*b*d)*x/(3*d)+d*x^3,x]^p,x],x,x+c/(3*d)] /;
 NeQ[c,0]] /;
FreeQ[{e,f,m,p},x] && PolyQ[P3,x,3]

Rules for integrands of the formu(((a+b x+c (x^2)+d (x^3)+e (x^4)))^p)

1.  ∫((A+B x)/(Sqrt[a+b x+c (x^2)+d (x^3)+e (x^4)]))dx  when  B d-4 A e==0 ∧ d (141 (d^3)-752 c d e-400 b (e^2))+16 (e^2) (71 (c^2)+100 a e)==0 ∧  144 (((3 (d^2)-8 c e))^3)+125 ((((d^3)-4 c d e+8 b (e^2)))^2)==0

1:  ∫(x/(Sqrt[a+b x+c (x^2)+e (x^4)]))dx  when  71 (c^2)+100 a e==0∧ 1152 (c^3)-125 (b^2) e==0

Reference: Bronstein

Rule: If  71 (c^2)+100 a e==0∧ 1152 (c^3)-125 (b^2) e==0, let 
P[x]->(1/320) (33 (b^2) c+6 a (c^2)+40 (a^2) e)-(22/5) a c e (x^2)+(22/15) b c e (x^3)+(1/4) e (5 (c^2)+4 a e) (x^4)+(4/3) b (e^2) (x^5)+2 c (e^2) (x^6)+(e^3) (x^8), then

∫(x/(Sqrt[a+b x+c (x^2)+e (x^4)]))dx  ⟶  (1/(8 (Sqrt[e]))) Log[P[x]+(((∂_x)P[x])/(8 (Sqrt[e]) x))(Sqrt[a+b x+c (x^2)+e (x^4)])]

Program code:

Int[x_/Sqrt[a_+b_.*x_+c_.*x_^2+e_.*x_^4],x_Symbol] :=
  With[{Px=1/320*(33*b^2*c+6*a*c^2+40*a^2*e)-22/5*a*c*e*x^2+22/15*b*c*e*x^3+1/4*e*(5*c^2+4*a*e)*x^4+
    4/3*b*e^2*x^5+2*c*e^2*x^6+e^3*x^8},
  1/(8*Rt[e,2])*Log[Px+Dist[1/(8*Rt[e,2]*x),D[Px,x],x]*Sqrt[a+b*x+c*x^2+e*x^4]]] /;
FreeQ[{a,b,c,e},x] && EqQ[71*c^2+100*a*e,0] && EqQ[1152*c^3-125*b^2*e,0]

2:  ∫((A+B x)/(Sqrt[a+b x+c (x^2)+d (x^3)+e (x^4)]))dx  when  B d-4 A e==0 ∧ 
d (141 (d^3)-752 c d e-400 b (e^2))+16 (e^2) (71 (c^2)+100 a e)==0 ∧  144 (((3 (d^2)-8 c e))^3)+125 ((((d^3)-4 c d e+8 b (e^2)))^2)==0

Derivation: Integration by substitution

Rule: If  B d-4 A e==0 ∧ d (141 (d^3)-752 c d e-400 b (e^2))+16 (e^2) (71 (c^2)+100 a e)==0 ∧ 144 (((3 (d^2)-8 c e))^3)+125 ((((d^3)-4 c d e+8 b (e^2)))^2)==0, then

∫((A+B x)/(Sqrt[a+b x+c (x^2)+d (x^3)+e (x^4)]))dx  ⟶  B Subst[∫(x/(Sqrt[((-3 (d^4)+16 c (d^2) e-64 b d (e^2)+256 a (e^3))/(256 (e^3)))+((((d^3)-4 c d e+8 b (e^2)) x)/(8 (e^2)))-(((3 (d^2)-8 c e) (x^2))/(8 e))+e (x^4)]))dx,x,(d/(4 e))+x]

Program code:

Int[(A_+B_.*x_)/Sqrt[a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4],x_Symbol] :=
  B*Subst[Int[x/Sqrt[(-3*d^4+16*c*d^2*e-64*b*d*e^2+256*a*e^3)/(256*e^3)+(d^3-4*c*d*e+8*b*e^2)*x/(8*e^2)-
    (3*d^2-8*c*e)*x^2/(8*e)+e*x^4],x],x,d/(4*e)+x] /;
FreeQ[{a,b,c,d,e,A,B},x] && EqQ[B*d-4*A*e,0] && 
  EqQ[d*(141*d^3-752*c*d*e-400*b*e^2)+16*e^2*(71*c^2+100*a*e),0] && 
  EqQ[144*(3*d^2-8*c*e)^3+125*(d^3-4*c*d*e+8*b*e^2)^2,0]

2.  ∫((f+g (x^2))/((d+e x+d (x^2)) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))dx  when  b d-a e==0 ∧ f+g==0

1:  ∫((f+g (x^2))/((d+e x+d (x^2)) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))dx  when  b d-a e==0 ∧ f+g==0 ∧ (a^2) (2 a-c)>0

Rule: If  b d-a e==0 ∧ f+g==0 ∧ (a^2) (2 a-c)>0, then

∫((f+g (x^2))/((d+e x+d (x^2)) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))dx  ⟶  ((a f)/(d(Sqrt[(a^2) (2 a-c)])))ArcTan[((a b+(4 (a^2)+(b^2)-2 a c) x+a b (x^2))/(2 (Sqrt[(a^2) (2 a-c)]) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))]

Program code:

Int[(f_+g_.*x_^2)/((d_+e_.*x_+d_.*x_^2)*Sqrt[a_+b_.*x_+c_.*x_^2+b_.*x_^3+a_.*x_^4]),x_Symbol] :=
  a*f/(d*Rt[a^2*(2*a-c),2])*ArcTan[(a*b+(4*a^2+b^2-2*a*c)*x+a*b*x^2)/(2*Rt[a^2*(2*a-c),2]*Sqrt[a+b*x+c*x^2+b*x^3+a*x^4])] /;
FreeQ[{a,b,c,d,e,f,g},x] && EqQ[b*d-a*e,0] && EqQ[f+g,0] && PosQ[a^2*(2*a-c)]

2:  ∫((f+g (x^2))/((d+e x+d (x^2)) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))dx  when  b d-a e==0 ∧ f+g==0 ∧ (a^2) (2 a-c)≯0

Rule: If  b d-a e==0 ∧ f+g==0 ∧ (a^2) (2 a-c)≯0, then

∫((f+g (x^2))/((d+e x+d (x^2)) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))dx  ⟶  -((a f)/(d(Sqrt[-(a^2) (2 a-c)])))ArcTanh[((a b+(4 (a^2)+(b^2)-2 a c) x+a b (x^2))/(2 (Sqrt[-(a^2) (2 a-c)]) (Sqrt[a+b x+c (x^2)+b (x^3)+a (x^4)])))]

Program code:

Int[(f_+g_.*x_^2)/((d_+e_.*x_+d_.*x_^2)*Sqrt[a_+b_.*x_+c_.*x_^2+b_.*x_^3+a_.*x_^4]),x_Symbol] :=
  -a*f/(d*Rt[-a^2*(2*a-c),2])*ArcTanh[(a*b+(4*a^2+b^2-2*a*c)*x+a*b*x^2)/(2*Rt[-a^2*(2*a-c),2]*Sqrt[a+b*x+c*x^2+b*x^3+a*x^4])] /;
FreeQ[{a,b,c,d,e,f,g},x] && EqQ[b*d-a*e,0] && EqQ[f+g,0] && NegQ[a^2*(2*a-c)]

3.  ∫((u(A+B x+C (x^2)+D (x^3)))/(a+b x+c (x^2)+b (x^3)+a (x^4)))dx

1:  ∫((A+B x+C (x^2)+D (x^3))/(a+b x+c (x^2)+b (x^3)+a (x^4)))dx

Derivation: Algebraic expansion

Basis: Let q->(Sqrt[8 (a^2)+(b^2)-4 a c]), then ((A+B x+C (x^2)+D (x^3))/(a+b x+c (x^2)+b (x^3)+a (x^4)))==((b A-2 a B+2 a D+A q+(2 a A-2 a C+b D+D q) x)/(q (2 a+(b+q) x+2 a (x^2))))-((b A-2 a B+2 a D-A q+(2 a A-2 a C+b D-D q) x)/(q (2 a+(b-q) x+2 a (x^2))))

Rule: Let q->(Sqrt[8 (a^2)+(b^2)-4 a c]), then

∫((A+B x+C (x^2)+D (x^3))/(a+b x+c (x^2)+b (x^3)+a (x^4)))dx  ⟶  
(1/q)∫((b A-2 a B+2 a D+A q+(2 a A-2 a C+b D+D q) x)/(2 a+(b+q) x+2 a (x^2)))dx-(1/q)∫((b A-2 a B+2 a D-A q+(2 a A-2 a C+b D-D q) x)/(2 a+(b-q) x+2 a (x^2)))dx

Program code:

Int[P3_/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Sqrt[8*a^2+b^2-4*a*c],A=Coeff[P3,x,0],B=Coeff[P3,x,1],C=Coeff[P3,x,2],D=Coeff[P3,x,3]},
  1/q*Int[(b*A-2*a*B+2*a*D+A*q+(2*a*A-2*a*C+b*D+D*q)*x)/(2*a+(b+q)*x+2*a*x^2),x] -
  1/q*Int[(b*A-2*a*B+2*a*D-A*q+(2*a*A-2*a*C+b*D-D*q)*x)/(2*a+(b-q)*x+2*a*x^2),x]] /;
FreeQ[{a,b,c},x] && PolyQ[P3,x,3] && EqQ[a,e] && EqQ[b,d]

2:  ∫(((x^m)(A+B x+C (x^2)+D (x^3)))/(a+b x+c (x^2)+b (x^3)+a (x^4)))dx

Derivation: Algebraic expansion

Basis: Let q->(Sqrt[8 (a^2)+(b^2)-4 a c]), then ((A+B x+C (x^2)+D (x^3))/(a+b x+c (x^2)+b (x^3)+a (x^4)))==((b A-2 a B+2 a D+A q+(2 a A-2 a C+b D+D q) x)/(q (2 a+(b+q) x+2 a (x^2))))-((b A-2 a B+2 a D-A q+(2 a A-2 a C+b D-D q) x)/(q (2 a+(b-q) x+2 a (x^2))))

Rule: Let q->(Sqrt[8 (a^2)+(b^2)-4 a c]), then

∫(((x^m)(A+B x+C (x^2)+D (x^3)))/(a+b x+c (x^2)+b (x^3)+a (x^4)))dx  ⟶  
(1/q)∫(((x^m)(b A-2 a B+2 a D+A q+(2 a A-2 a C+b D+D q) x))/(2 a+(b+q) x+2 a (x^2)))dx-(1/q)∫(((x^m)(b A-2 a B+2 a D-A q+(2 a A-2 a C+b D-D q) x))/(2 a+(b-q) x+2 a (x^2)))dx

Program code:

Int[x_^m_.*P3_/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Sqrt[8*a^2+b^2-4*a*c],A=Coeff[P3,x,0],B=Coeff[P3,x,1],C=Coeff[P3,x,2],D=Coeff[P3,x,3]},
  1/q*Int[x^m*(b*A-2*a*B+2*a*D+A*q+(2*a*A-2*a*C+b*D+D*q)*x)/(2*a+(b+q)*x+2*a*x^2),x] -
  1/q*Int[x^m*(b*A-2*a*B+2*a*D-A*q+(2*a*A-2*a*C+b*D-D*q)*x)/(2*a+(b-q)*x+2*a*x^2),x]] /;
FreeQ[{a,b,c,m},x] && PolyQ[P3,x,3] && EqQ[a,e] && EqQ[b,d]

4.  ∫((A+B x+C (x^2))/(a+b x+c (x^2)+d (x^3)+e (x^4)))dx  when (B^2) d+2 C (b C+A d)-2 B (c C+2 A e)==0 ∧ 2 (B^2) c C-8 a (C^3)-(B^3) d-4 A B C d+4 A ((B^2)+2 A C) e==0

1:  ∫((A+B x+C (x^2))/(a+b x+c (x^2)+d (x^3)+e (x^4)))dx  when (B^2) d+2 C (b C+A d)-2 B (c C+2 A e)==0 ∧ 2 (B^2) c C-8 a (C^3)-(B^3) d-4 A B C d+4 A ((B^2)+2 A C) e==0 ∧ C (2 e (B d-4 A e)+C ((d^2)-4 c e))>0

Rule: If  (B^2) d+2 C (b C+A d)-2 B (c C+2 A e)==0 ∧ 2 (B^2) c C-8 a (C^3)-(B^3) d-4 A B C d+4 A ((B^2)+2 A C) e==0 ∧ C (2 e (B d-4 A e)+C ((d^2)-4 c e))>0, 
		let q->(Sqrt[C (2 e (B d-4 A e)+C ((d^2)-4 c e))]), then

∫((A+B x+C (x^2))/(a+b x+c (x^2)+d (x^3)+e (x^4)))dx  ⟶  

-((2 (C^2))/q) ArcTanh[((C d-B e+2 C e x)/q)]+((2 (C^2))/q) ArcTanh[((C (4 B c C-3 (B^2) d-4 A C d+12 A B e+4 C (2 c C-B d+2 A e) x+4 C (2 C d-B e) (x^2)+8 (C^2) e (x^3)))/(q ((B^2)-4 A C)))]

Program code:

Int[(A_.+B_.*x_+C_.*x_^2)/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Rt[C*(2*e*(B*d-4*A*e)+C*(d^2-4*c*e)),2]},
  -2*C^2/q*ArcTanh[(C*d-B*e+2*C*e*x)/q] + 
  2*C^2/q*ArcTanh[C*(4*B*c*C-3*B^2*d-4*A*C*d+12*A*B*e+4*C*(2*c*C-B*d+2*A*e)*x+4*C*(2*C*d-B*e)*x^2+8*C^2*e*x^3)/(q*(B^2-4*A*C))]] /;
FreeQ[{a,b,c,d,e,A,B,C},x] && EqQ[B^2*d+2*C*(b*C+A*d)-2*B*(c*C+2*A*e),0] && 
  EqQ[2*B^2*c*C-8*a*C^3-B^3*d-4*A*B*C*d+4*A*(B^2+2*A*C)*e,0] && PosQ[C*(2*e*(B*d-4*A*e)+C*(d^2-4*c*e))]

Int[(A_.+C_.*x_^2)/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Rt[C*(-8*A*e^2+C*(d^2-4*c*e)),2]},
  -2*C^2/q*ArcTanh[C*(d+2*e*x)/q] + 2*C^2/q*ArcTanh[C*(A*d-2*(c*C+A*e)*x-2*C*d*x^2-2*C*e*x^3)/(A*q)]] /;
FreeQ[{a,b,c,d,e,A,C},x] && EqQ[b*C+A*d,0] && EqQ[a*C^2-A^2*e,0] && PosQ[C*(-8*A*e^2+C*(d^2-4*c*e))]

2:  ∫((A+B x+C (x^2))/(a+b x+c (x^2)+d (x^3)+e (x^4)))dx  when (B^2) d+2 C (b C+A d)-2 B (c C+2 A e)==0 ∧ 2 (B^2) c C-8 a (C^3)-(B^3) d-4 A B C d+4 A ((B^2)+2 A C) e==0 ∧ C (2 e (B d-4 A e)+C ((d^2)-4 c e))≯0

Rule: If  (B^2) d+2 C (b C+A d)-2 B (c C+2 A e)==0 ∧ 2 (B^2) c C-8 a (C^3)-(B^3) d-4 A B C d+4 A ((B^2)+2 A C) e==0 ∧ C (2 e (B d-4 A e)+C ((d^2)-4 c e))≯0, 
		let q=(Sqrt[-C (2 e (B d-4 A e)+C ((d^2)-4 c e))]), then

∫((A+B x+C (x^2))/(a+b x+c (x^2)+d (x^3)+e (x^4)))dx  ⟶  

((2 (C^2))/q) ArcTan[((C d-B e+2 C e x)/q)]-((2 (C^2))/q) ArcTan[((C (4 B c C-3 (B^2) d-4 A C d+12 A B e+4 C (2 c C-B d+2 A e) x+4 C (2 C d-B e) (x^2)+8 (C^2) e (x^3)))/(q ((B^2)-4 A C)))]

Program code:

Int[(A_.+B_.*x_+C_.*x_^2)/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Rt[-C*(2*e*(B*d-4*A*e)+C*(d^2-4*c*e)),2]},
  2*C^2/q*ArcTan[(C*d-B*e+2*C*e*x)/q] - 
  2*C^2/q*ArcTan[C*(4*B*c*C-3*B^2*d-4*A*C*d+12*A*B*e+4*C*(2*c*C-B*d+2*A*e)*x+4*C*(2*C*d-B*e)*x^2+8*C^2*e*x^3)/(q*(B^2-4*A*C))]] /;
FreeQ[{a,b,c,d,e,A,B,C},x] && EqQ[B^2*d+2*C*(b*C+A*d)-2*B*(c*C+2*A*e),0] && 
  EqQ[2*B^2*c*C-8*a*C^3-B^3*d-4*A*B*C*d+4*A*(B^2+2*A*C)*e,0] && NegQ[C*(2*e*(B*d-4*A*e)+C*(d^2-4*c*e))]

Int[(A_.+C_.*x_^2)/(a_+b_.*x_+c_.*x_^2+d_.*x_^3+e_.*x_^4),x_Symbol] :=
  With[{q=Rt[-C*(-8*A*e^2+C*(d^2-4*c*e)),2]},
  2*C^2/q*ArcTan[(C*d+2*C*e*x)/q] - 2*C^2/q*ArcTan[-C*(-A*d+2*(c*C+A*e)*x+2*C*d*x^2+2*C*e*x^3)/(A*q)]] /;
FreeQ[{a,b,c,d,e,A,C},x] && EqQ[b*C+A*d,0] && EqQ[a*C^2-A^2*e,0] && NegQ[C*(-8*A*e^2+C*(d^2-4*c*e))]

5:  ∫P[x] (((a+b x+c (x^2)+d (x^3)+e (x^4)))^p)dx  when  p∈(SuperMinus[ℤ])∧ a≠0 ∧ c==((b^2)/a) ∧ d==((b^3)/(a^2)) ∧ e==((b^4)/(a^3))

Derivation: Algebraic simplification

Basis: If  a≠0 ∧ c==((b^2)/a) ∧ d==((b^3)/(a^2)) ∧ e==((b^4)/(a^3)), then  a+b x+c (x^2)+d (x^3)+e (x^4)==(((a^5)-(b^5) (x^5))/((a^3) (a-b x)))

Rule: If  p∈(SuperMinus[ℤ])∧ a≠0 ∧ c==((b^2)/a) ∧ d==((b^3)/(a^2)) ∧ e==((b^4)/(a^3)), then

∫P[x] (((a+b x+c (x^2)+d (x^3)+e (x^4)))^p)dx  ⟶  (1/(a^(3 p))) ∫ExpandIntegrand[((P[x] (((a-b x))^(-p)))/((((a^5)-(b^5) (x^5)))^(-p))),x] dx

Program code:

Int[Px_*P4_^p_,x_Symbol] :=
  With[{a=Coeff[P4,x,0],b=Coeff[P4,x,1],c=Coeff[P4,x,2],d=Coeff[P4,x,3],e=Coeff[P4,x,4]},
  1/a^(3*p)*Int[ExpandIntegrand[Px*(a-b*x)^(-p)/(a^5-b^5*x^5)^(-p),x],x] /;
 NeQ[a,0] && EqQ[c,b^2/a] && EqQ[d,b^3/a^2] && EqQ[e,b^4/a^3]] /;
FreeQ[p,x] && PolyQ[P4,x,4] && PolyQ[Px,x] && ILtQ[p,0]

Rules for integrands of the form(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)

1.  ∫((u(A+B (x^n)))/(a+b (x^(2(m+1)))+c (x^n)+d (x^(2n))))dx

1:  ∫((A+B (x^n))/(a+b (x^2)+c (x^n)+d (x^(2n))))dx  when a (B^2)-(A^2) d(((n-1))^2)==0 ∧ B c+2 A d(n-1)==0

Derivation: Integration by substitution

Basis: If  a (B^2)-(A^2) d(((n-1))^2)==0 ∧ B c+2 A d(n-1)==0, then ((A+B (x^n))/(a+b (x^2)+c (x^n)+d (x^(2n))))==(A^2) (n-1) Subst[(1/(a+(A^2) b (((n-1))^2) (x^2))),x,(x/(A (n-1)-B (x^n)))] (∂_x)(x/(A (n-1)-B (x^n)))

Rule 1.3.3.16.1: If  a (B^2)-(A^2) d(((n-1))^2)==0 ∧ B c+2 A d(n-1)==0, then

∫((A+B (x^n))/(a+b (x^2)+c (x^n)+d (x^(2n))))dx  ⟶  (A^2) (n-1) Subst[∫(1/(a+(A^2) b (((n-1))^2) (x^2)))dx,x,(x/(A (n-1)-B (x^n)))]

Program code:

Int[(A_+B_.*x_^n_)/(a_+b_.*x_^2+c_.*x_^n_+d_.*x_^n2_), x_Symbol] :=
  A^2*(n-1)*Subst[Int[1/(a+A^2*b*(n-1)^2*x^2),x],x,x/(A*(n-1)-B*x^n)] /;
FreeQ[{a,b,c,d,A,B,n},x] && EqQ[n2,2*n] && NeQ[n,2] && EqQ[a*B^2-A^2*d*(n-1)^2,0] && EqQ[B*c+2*A*d*(n-1),0]

2:  ∫(((x^m)(A+B (x^n)))/(a+b (x^(2(m+1)))+c (x^n)+d (x^(2n))))dx  when a (B^2)(((m+1))^2)-(A^2) d(((m-n+1))^2)==0 ∧ B c(m+1)-2A d(m-n+1)==0

Derivation: Integration by substitution

Basis: If  a (B^2)(((m+1))^2)-(A^2) d(((m-n+1))^2)==0 ∧ B c(m+1)-2A d(m-n+1)==0, 
	then (((x^m)(A+B (x^n)))/(a+b (x^(2(m+1)))+c (x^n)+d (x^(2n))))==(((A^2) (m-n+1))/(m+1))Subst[(1/(a+(A^2) b (((m-n+1))^2) (x^2))),x,((x^(m+1))/(A(m-n+1)+B(m+1)(x^n)))] (∂_x)((x^(m+1))/(A(m-n+1)+B(m+1)(x^n)))

Rule 1.3.3.16.2: If  a (B^2)(((m+1))^2)-(A^2) d(((m-n+1))^2)==0 ∧ B c(m+1)-2A d(m-n+1)==0, then

∫(((x^m)(A+B (x^n)))/(a+b (x^(2(m+1)))+c (x^n)+d (x^(2n))))dx  ⟶  (((A^2) (m-n+1))/(m+1)) Subst[∫(1/(a+(A^2) b (((m-n+1))^2) (x^2)))dx,x,((x^(m+1))/(A(m-n+1)+B(m+1)(x^n)))]

Program code:

Int[x_^m_.*(A_+B_.*x_^n_.)/(a_+b_.*x_^k_.+c_.*x_^n_.+d_.*x_^n2_), x_Symbol] :=
  A^2*(m-n+1)/(m+1)*Subst[Int[1/(a+A^2*b*(m-n+1)^2*x^2),x],x,x^(m+1)/(A*(m-n+1)+B*(m+1)*x^n)] /;
FreeQ[{a,b,c,d,A,B,m,n},x] && EqQ[n2,2*n] && EqQ[k,2*(m+1)] && EqQ[a*B^2*(m+1)^2-A^2*d*(m-n+1)^2,0] && EqQ[B*c*(m+1)-2*A*d*(m-n+1),0]

2.  ∫u (((Subscript[Q, 6])[x])^p)dx  when  p∈(SuperMinus[ℤ])

1:  ∫((a+b (x^2)+c (x^4))/(d+e (x^2)+f (x^4)+g (x^6)))dx  when -9 (c^3) (d^2)+c d f ((b^2)+6 a c)-(a^2) c (f^2)-2 a b g (3 c d+a f)+12 (a^3) (g^2) ==0 ∧ 3 (c^4) (d^2) e-3 (a^2) (c^2) d f g+(a^3) c (f^2) g+2 (a^3) (g^2) (b f-6 a g)-(c^3) d (2 b d f+a e f-12 a d g)==0 ∧ ((-a c (f^2)+12 (a^2) (g^2)+f (3 (c^2) d-2 a b g))/(c g (3 c d-a f)))>0

Rule 1.3.3.17.1: If  -9 (c^3) (d^2)+c d f ((b^2)+6 a c)-(a^2) c (f^2)-2 a b g (3 c d+a f)+12 (a^3) (g^2) ==0 ∧ 3 (c^4) (d^2) e-3 (a^2) (c^2) d f g+(a^3) c (f^2) g+2 (a^3) (g^2) (b f-6 a g)-(c^3) d (2 b d f+a e f-12 a d g)==0 ∧ ((-a c (f^2)+12 (a^2) (g^2)+f (3 (c^2) d-2 a b g))/(c g (3 c d-a f)))>0, 
		let q->(Sqrt[((-a c (f^2)+12 (a^2) (g^2)+f (3 (c^2) d-2 a b g))/(c g (3 c d-a f)))]) and r->(Sqrt[((a c (f^2)+4 g (b c d+(a^2) g)-f (3 (c^2) d+2 a b g))/(c g (3 c d-a f)))]), then

∫((a+b (x^2)+c (x^4))/(d+e (x^2)+f (x^4)+g (x^6)))dx  ⟶  

(c/(g q)) ArcTan[((r+2 x)/q)]-(c/(g q)) ArcTan[((r-2 x)/q)]-
(c/(g q)) ArcTan[(((3 c d-a f) x (b (c^2) d f-a (b^2) f g-2 (a^2) c f g+6 (a^2) b (g^2)+c (3 (c^2) d f-a c (f^2)-b c d g+2 (a^2) (g^2)) (x^2)+(c^2) g (3 c d-a f) (x^4)))/(g q (b c d-2 (a^2) g) (b c d-a b f+4 (a^2) g)))]

Program code:

Int[(a_+b_.*x_^2+c_.*x_^4)/(d_+e_.*x_^2+f_.*x_^4+g_.*x_^6),x_Symbol] :=
  With[{q=Rt[(-a*c*f^2+12*a^2*g^2+f*(3*c^2*d-2*a*b*g))/(c*g*(3*c*d-a*f)),2],
        r=Rt[(a*c*f^2+4*g*(b*c*d+a^2*g)-f*(3*c^2*d+2*a*b*g))/(c*g*(3*c*d-a*f)),2]},
  c/(g*q)*ArcTan[(r+2*x)/q] - 
  c/(g*q)*ArcTan[(r-2*x)/q] - 
  c/(g*q)*ArcTan[(3*c*d-a*f)*x/(g*q*(b*c*d-2*a^2*g)*(b*c*d-a*b*f+4*a^2*g))*
    (b*c^2*d*f-a*b^2*f*g-2*a^2*c*f*g+6*a^2*b*g^2+c*(3*c^2*d*f-a*c*f^2-b*c*d*g+2*a^2*g^2)*x^2+c^2*g*(3*c*d-a*f)*x^4)]] /;
FreeQ[{a,b,c,d,e,f,g},x] && EqQ[9*c^3*d^2-c*(b^2+6*a*c)*d*f+a^2*c*f^2+2*a*b*(3*c*d+a*f)*g-12*a^3*g^2,0] && 
  EqQ[3*c^4*d^2*e-3*a^2*c^2*d*f*g+a^3*c*f^2*g+2*a^3*g^2*(b*f-6*a*g)-c^3*d*(2*b*d*f+a*e*f-12*a*d*g),0] && 
  NeQ[3*c*d-a*f,0] && NeQ[b*c*d-2*a^2*g,0] && NeQ[b*c*d-a*b*f+4*a^2*g,0] && 
  PosQ[(-a*c*f^2+12*a^2*g^2+f*(3*c^2*d-2*a*b*g))/(c*g*(3*c*d-a*f))]

Int[(a_+c_.*x_^4)/(d_+e_.*x_^2+f_.*x_^4+g_.*x_^6),x_Symbol] :=
  With[{q=Rt[(-a*c*f^2+12*a^2*g^2+3*f*c^2*d)/(c*g*(3*c*d-a*f)),2],
        r=Rt[(a*c*f^2+4*a^2*g^2-3*c^2*d*f)/(c*g*(3*c*d-a*f)),2]},
  c/(g*q)*ArcTan[(r+2*x)/q] - 
  c/(g*q)*ArcTan[(r-2*x)/q] - 
  c/(g*q)*ArcTan[(c*(3*c*d-a*f)*x*(2*a^2*f*g-(3*c^2*d*f-a*c*f^2+2*a^2*g^2)*x^2-c*(3*c*d-a*f)*g*x^4))/(8*a^4*g^3*q)]] /;
FreeQ[{a,c,d,e,f,g},x] && EqQ[9*c^3*d^2-6*a*c^2*d*f+a^2*c*f^2-12*a^3*g^2,0] && 
  EqQ[3*c^4*d^2*e-3*a^2*c^2*d*f*g+a^3*c*f^2*g-12*a^4*g^3-a*c^3*d*(e*f-12*d*g),0] && 
  NeQ[3*c*d-a*f,0] && PosQ[(-a*c*f^2+12*a^2*g^2+3*c^2*d*f)/(c*g*(3*c*d-a*f))]

2:  ∫u (((a+b (x^2)+c (x^3)+d (x^4)+e (x^6)))^p)dx  when  p∈(SuperMinus[ℤ])∧ (b^2)-3 a d==0 ∧ (b^3)-27 (a^2) e==0

Algebraic expansion

Basis: If  (b^2)-3 a d==0 ∧ (b^3)-27 (a^2) e==0, then a+b (x^2)+c (x^3)+d (x^4)+e (x^6)==(1/(27 (a^2))) (3 a+3 (a^(2/3)) (c^(1/3)) x+b (x^2)) (3 a-3 (((-1))^(1/3)) (a^(2/3)) (c^(1/3)) x+b (x^2)) (3 a+3 (((-1))^(2/3)) (a^(2/3)) (c^(1/3)) x+b (x^2))

Note: If  ((m+1)/2)∈(SuperPlus[ℤ]), then c (x^m)+(((a+b (x^2)))^m)==(∏_(k=1)^m)(a+(((-1))^(k (1-(1/m)))) (c^(1/m)) x+b (x^2))

Rule 1.3.3.17.2: If  p∈(SuperMinus[ℤ])∧ (b^2)-3 a d==0 ∧ (b^3)-27 (a^2) e==0, then

∫u (((a+b (x^2)+c (x^3)+d (x^4)+e (x^6)))^p)dx  ⟶  
(1/((3^(3 p)) (a^(2 p)))) ∫ExpandIntegrand[u (((3 a+3 (a^(2/3)) (c^(1/3)) x+b (x^2)))^p) (((3 a-3 (((-1))^(1/3)) (a^(2/3)) (c^(1/3)) x+b (x^2)))^p) (((3 a+3 (((-1))^(2/3)) (a^(2/3)) (c^(1/3)) x+b (x^2)))^p),x]dx

Program code:

Int[u_*Q6_^p_,x_Symbol] :=
  With[{a=Coeff[Q6,x,0],b=Coeff[Q6,x,2],c=Coeff[Q6,x,3],d=Coeff[Q6,x,4],e=Coeff[Q6,x,6]},
  1/(3^(3*p)*a^(2*p))*Int[ExpandIntegrand[u*
    (3*a+3*Rt[a,3]^2*Rt[c,3]*x+b*x^2)^p*
    (3*a-3*(-1)^(1/3)*Rt[a,3]^2*Rt[c,3]*x+b*x^2)^p*
    (3*a+3*(-1)^(2/3)*Rt[a,3]^2*Rt[c,3]*x+b*x^2)^p,x],x] /;
 EqQ[b^2-3*a*d,0] && EqQ[b^3-27*a^2*e,0]] /;
ILtQ[p,0] && PolyQ[Q6,x,6] && EqQ[Coeff[Q6,x,1],0] && EqQ[Coeff[Q6,x,5],0] && RationalFunctionQ[u,x]

3.  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  m==n-1

1.  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])==0

1:  ∫(((Subscript[P, m])[x])/((Subscript[Q, n])[x]))dx  when  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])==0

Derivation: Algebraic expansion and reciprocal integration rule

Rule 1.3.3.18.2.1: If  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])==0, then

∫(((Subscript[P, m])[x])/((Subscript[Q, n])[x]))dx  ⟶  (((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) ∫(((∂_x)(Subscript[Q, n])[x])/((Subscript[Q, n])[x]))dx+((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x]) ∫(1/((Subscript[Q, n])[x]))dx

  ⟶  (((Subscript[P, m])[x,m] Log[(Subscript[Q, n])[x]])/(n (Subscript[Q, n])[x,n]))+((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x]) ∫(1/((Subscript[Q, n])[x]))dx

Program code:

Int[Pm_/Qn_,x_Symbol] :=
  With[{m=Expon[Pm,x],n=Expon[Qn,x]},
  Coeff[Pm,x,m]*Log[Qn]/(n*Coeff[Qn,x,n]) + Simplify[Pm-Coeff[Pm,x,m]*D[Qn,x]/(n*Coeff[Qn,x,n])]*Int[1/Qn,x]/;
 EqQ[m,n-1] && EqQ[D[Simplify[Pm-Coeff[Pm,x,m]/(n*Coeff[Qn,x,n])*D[Qn,x]],x],0]] /;
PolyQ[Pm,x] && PolyQ[Qn,x]

2:  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])==0 ∧ p≠-1

Derivation: Algebraic expansion and power integration rule

Rule 1.3.3.18.2.2: If  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])==0 ∧ p≠-1, then

∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  ⟶  (((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) ∫(((Subscript[Q, n])[x])^p) (∂_x)(Subscript[Q, n])[x]dx+((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x]) ∫(((Subscript[Q, n])[x])^p)dx

  ⟶  (((Subscript[P, m])[x,m] (((Subscript[Q, n])[x])^(p+1)))/(n (p+1) (Subscript[Q, n])[x,n]))+((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x]) ∫(((Subscript[Q, n])[x])^p)dx

Program code:

Int[Pm_*Qn_^p_,x_Symbol] :=
  With[{m=Expon[Pm,x],n=Expon[Qn,x]},
  Coeff[Pm,x,m]*Qn^(p+1)/(n*(p+1)*Coeff[Qn,x,n]) + Simplify[Pm-Coeff[Pm,x,m]*D[Qn,x]/(n*Coeff[Qn,x,n])]*Int[Qn^p,x]/;
 EqQ[m,n-1] && EqQ[D[Simplify[Pm-Coeff[Pm,x,m]/(n*Coeff[Qn,x,n])*D[Qn,x]],x],0]] /;
FreeQ[p,x] && PolyQ[Pm,x] && PolyQ[Qn,x] && NeQ[p,-1]

2.  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  m==n-1 ∧ (∂_x)((Subscript[P, m])[x]-(((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) (∂_x)(Subscript[Q, n])[x])≠0

1:  ∫(((Subscript[P, m])[x])/((Subscript[Q, n])[x]))dx  when  m==n-1

Derivation: Algebraic expansion and reciprocal integration rule

Rule 1.3.3.18.2.1: If  m==n-1, then

∫(((Subscript[P, m])[x])/((Subscript[Q, n])[x]))dx  ⟶  (((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) ∫(((∂_x)(Subscript[Q, n])[x])/((Subscript[Q, n])[x]))dx+(1/(n (Subscript[Q, n])[x,n])) ∫((n (Subscript[Q, n])[x,n] (Subscript[P, m])[x]-(Subscript[P, m])[x,m] (∂_x)(Subscript[Q, n])[x])/((Subscript[Q, n])[x]))dx

  ⟶  (((Subscript[P, m])[x,m] Log[(Subscript[Q, n])[x]])/(n (Subscript[Q, n])[x,n]))+(1/(n (Subscript[Q, n])[x,n])) ∫((n (Subscript[Q, n])[x,n] (Subscript[P, m])[x]-(Subscript[P, m])[x,m] (∂_x)(Subscript[Q, n])[x])/((Subscript[Q, n])[x]))dx

Program code:

Int[Pm_/Qn_,x_Symbol] :=
  With[{m=Expon[Pm,x],n=Expon[Qn,x]},
  Coeff[Pm,x,m]*Log[Qn]/(n*Coeff[Qn,x,n]) + 
  1/(n*Coeff[Qn,x,n])Int[ExpandToSum[n*Coeff[Qn,x,n]*Pm-Coeff[Pm,x,m]*D[Qn,x],x]/Qn,x]/;
 EqQ[m,n-1]] /;
PolyQ[Pm,x] && PolyQ[Qn,x]

2:  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  m==n-1 ∧ p≠-1

Derivation: Algebraic expansion and power integration rule

Rule 1.3.3.18.2.2: If  m==n-1 ∧ p≠-1, then

∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  ⟶  (((Subscript[P, m])[x,m])/(n (Subscript[Q, n])[x,n])) ∫(((Subscript[Q, n])[x])^p) (∂_x)(Subscript[Q, n])[x]dx+(1/(n (Subscript[Q, n])[x,n])) ∫(n (Subscript[Q, n])[x,n] (Subscript[P, m])[x]-(Subscript[P, m])[x,m] (∂_x)(Subscript[Q, n])[x]) (((Subscript[Q, n])[x])^p)dx

  ⟶  (((Subscript[P, m])[x,m] (((Subscript[Q, n])[x])^(p+1)))/(n (p+1) (Subscript[Q, n])[x,n]))+(1/(n (Subscript[Q, n])[x,n])) ∫(n (Subscript[Q, n])[x,n] (Subscript[P, m])[x]-(Subscript[P, m])[x,m] (∂_x)(Subscript[Q, n])[x]) (((Subscript[Q, n])[x])^p)dx

Program code:

Int[Pm_*Qn_^p_,x_Symbol] :=
  With[{m=Expon[Pm,x],n=Expon[Qn,x]},
  Coeff[Pm,x,m]*Qn^(p+1)/(n*(p+1)*Coeff[Qn,x,n]) + 
  1/(n*Coeff[Qn,x,n])*Int[ExpandToSum[n*Coeff[Qn,x,n]*Pm-Coeff[Pm,x,m]*D[Qn,x],x]*Qn^p,x]/;
 EqQ[m,n-1]] /;
FreeQ[p,x] && PolyQ[Pm,x] && PolyQ[Qn,x] && NeQ[p,-1]

4:  ∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  when  p<-1 ∧ 1<n<m+1 ∧ m+n p+1<0

Reference: G&R 2.104

Note: Special case of the Ostrogradskiy-Hermite method without the need to solve a system of linear equations.

Note: Finds one term of the rational part of the antiderivative, thereby reducing the degree of the polynomial in the numerator of the integrand.

Note: Requirement that m<2n-1 ensures new term is a proper fraction.

Rule 1.3.3.19: If  p<-1 ∧ 1<n<m+1 ∧ m+n p+1<0, then

∫(Subscript[P, m])[x] (((Subscript[Q, n])[x])^p)dx  ⟶  (((Subscript[P, m])[x,m] (x^(m-n+1)) (((Subscript[Q, n])[x])^(p+1)))/((m+n p+1) (Subscript[Q, n])[x,n]))+
(1/((m+n p+1) (Subscript[Q, n])[x,n]))∫((m+n p+1) (Subscript[Q, n])[x,n] (Subscript[P, m])[x]-(Subscript[P, m])[x,m] (x^(m-n)) ((m-n+1) (Subscript[Q, n])[x]+(p+1) x (∂_x)(Subscript[Q, n])[x])) (((Subscript[Q, n])[x])^p)dx

Program code:

Int[Pm_*Qn_^p_.,x_Symbol] :=
  With[{m=Expon[Pm,x],n=Expon[Qn,x]},
  Coeff[Pm,x,m]*x^(m-n+1)*Qn^(p+1)/((m+n*p+1)*Coeff[Qn,x,n]) + 
  1/((m+n*p+1)*Coeff[Qn,x,n])*
    Int[ExpandToSum[(m+n*p+1)*Coeff[Qn,x,n]*Pm-Coeff[Pm,x,m]*x^(m-n)*((m-n+1)*Qn+(p+1)*x*D[Qn,x]),x]*Qn^p,x] /;
 LtQ[1,n,m+1] && m+n*p+1<0] /;
FreeQ[p,x] && PolyQ[Pm,x] && PolyQ[Qn,x] && LtQ[p,-1]